home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- * RunMacro.ttx: Executes the macro in the current file (asks for arguments)
- * Author: Roberto Fabbri, fabbri@dimi.uniud.it
- * Distribution: Copyright 1995 Roberto Fabbri
- * This file is freely distributable provided it is
- * distributed in its entirety.
- *
- * Version: $VER: RunMacro.ttx 1.0 (01.06.95)
- * Version history:
- * 1.0 (01.06.95) Initial Release
- * Notes: The temp assignment MYREXX: is necessary for executing
- * arexx macros whose path contains spaces. Rx doesn't
- * execute macros if their file name is contained between
- * double quotes (nor single quotes) :(.
- **************************************************************************/
-
-
- OPTIONS RESULTS
-
- CALL TellUser("Executing Current File")
-
- GetScreenInfo
-
- PARSE VAR RESULT dum dum width dum dum dum dum '"' screenname '"' .
-
- outwin = '"CON:50/100/' || width || '/150/Executing ARexx Macro/Screen ' || screenname || '/Close/WAIT"'
-
- GetFilePath
-
- IF RC ~= 0 THEN DO
- CALL ReportError("Cannot locate this file's path")
- EXIT 5
- END
-
- filepath=RESULT
-
- pathf = DirOf(filepath)
- filef = FileOf(filepath)
-
- RESULT=''
-
- RequestStr PROMPT "Arguments"
-
- argum=RESULT
-
- ADDRESS COMMAND 'assign MYREXX: ' || '"' || pathf || '"'
- ADDRESS COMMAND 'rx >' outwin 'MYREXX:' || filef argum
- ADDRESS COMMAND 'assign MYREXX:'
-
- CALL TellUser("Done")
-
- EXIT 0
-
- ReportError: PROCEDURE
- PARSE ARG msg
- BeepScreen
- SetStatusBar TEMPORARY msg
- RETURN
-
-
- TellUser: PROCEDURE
- PARSE ARG msg
- SetStatusBar TEMPORARY msg
- RETURN
-
- FileOf: PROCEDURE
- PARSE ARG pathname
- here = LastPos("/", pathname)
- IF here = 0 THEN
- here = LastPos(":", pathname)
- IF here = 0 THEN
- RETURN("")
- ELSE
- RETURN(SubStr(pathname, here+1))
-
- DirOf: PROCEDURE
- PARSE ARG pathname
- here = LastPos("/", pathname)
- IF here = 0 THEN
- here = LastPos(":", pathname)
- IF here = 0 THEN
- RETURN("")
- ELSE
- RETURN(SubStr(pathname, 1, here))
-
-
-